]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
viewSelector: Bind <Ctrl>+<Return> for open new window
authorMaxim Ermilov <zaspire@rambler.ru>
Sat, 16 Jul 2011 19:27:05 +0000 (23:27 +0400)
committerMaxim Ermilov <zaspire@rambler.ru>
Sat, 16 Jul 2011 20:50:26 +0000 (00:50 +0400)
https://bugzilla.gnome.org/show_bug.cgi?id=613082

js/ui/appDisplay.js
js/ui/viewSelector.js

index 5f38de3a114efde14659bbb067fa6fd285ac1aad..992a954ed4337dfdc34dff1def8603e1d267ab30 100644 (file)
@@ -327,8 +327,16 @@ BaseAppSearchProvider.prototype = {
         params = Params.parse(params, { workspace: null,
                                         timestamp: null });
 
+        let workspace = params.workspace ? params.workspace.index() : -1;
+        let event = Clutter.get_current_event();
+        let modifiers = event ? Shell.get_event_state(event) : 0;
+        let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK;
+
         let app = this._appSys.get_app(id);
-        app.activate(params.workspace ? params.workspace.index() : -1);
+        if (openNewWindow)
+            app.open_new_window(workspace);
+        else
+            app.activate(workspace);
     },
 
     dragActivateResult: function(id, params) {
index 29110fdcebad1c9136dffcbe9efdd5014c7d3aaa..53b349c778ccb00ed4ae6c36ef2dc377b74c5e05 100644 (file)
@@ -141,13 +141,19 @@ SearchTab.prototype = {
                                      'edit-find');
 
         this._text.connect('text-changed', Lang.bind(this, this._onTextChanged));
-        this._text.connect('activate', Lang.bind(this, function (se) {
-            if (this._searchTimeoutId > 0) {
-                Mainloop.source_remove(this._searchTimeoutId);
-                this._doSearch();
+        this._text.connect('key-press-event', Lang.bind(this, function (o, e) {
+            // We can't connect to 'activate' here because search providers
+            // might want to do something with the modifiers in activateSelected.
+            let symbol = e.get_key_symbol();
+            if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
+                if (this._searchTimeoutId > 0) {
+                    Mainloop.source_remove(this._searchTimeoutId);
+                    this._doSearch();
+                }
+                this._searchResults.activateSelected();
+                return true;
             }
-            this._searchResults.activateSelected();
-            return true;
+            return false;
         }));
 
         this._entry.connect('notify::mapped', Lang.bind(this, this._onMapped));